#include "gfx/legato/generated/screen/le_gen_screen_Screen4.h"

// screen member widget declarations
leWidget* root0;

leWidget* Screen4_PanelWidget0;
leCircleWidget* Screen4_Circle10;
leCircleWidget* Screen4_Circle25;
leCircleWidget* Screen4_Circle40;
leCircleWidget* Screen4_Circle55;
leCircleWidget* Screen4_Circle70;
leCircleWidget* Screen4_Circle85;
leLineWidget* Screen4_Line0;
leLineWidget* Screen4_Line80;
leLineWidget* Screen4_Line160;
leLineWidget* Screen4_Line240;
leLineWidget* Screen4_Line320;
leLineWidget* Screen4_Line400;
leLineWidget* Screen4_Line480;
leLabelWidget* Screen4_TouchAnywhereLabel;

static leBool initialized = LE_FALSE;
static leBool showing = LE_FALSE;

leResult screenInit_Screen4(void)
{
    if(initialized == LE_TRUE)
        return LE_FAILURE;

    initialized = LE_TRUE;

    return LE_SUCCESS;
}

leResult screenShow_Screen4(void)
{
    if(showing == LE_TRUE)
        return LE_FAILURE;

    // layer 0
    root0 = leWidget_New();
    root0->fn->setSize(root0, 800, 480);
    root0->fn->setBackgroundType(root0, LE_WIDGET_BACKGROUND_NONE);
    root0->fn->setMargins(root0, 0, 0, 0, 0);
    root0->flags |= LE_WIDGET_IGNOREEVENTS;
    root0->flags |= LE_WIDGET_IGNOREPICK;

    Screen4_PanelWidget0 = leWidget_New();
    Screen4_PanelWidget0->fn->setPosition(Screen4_PanelWidget0, 0, 0);
    Screen4_PanelWidget0->fn->setSize(Screen4_PanelWidget0, 800, 480);
    Screen4_PanelWidget0->fn->setScheme(Screen4_PanelWidget0, &BaseBlack_ForegroundWhite);
    root0->fn->addChild(root0, (leWidget*)Screen4_PanelWidget0);

    Screen4_Circle10 = leCircleWidget_New();
    Screen4_Circle10->fn->setPosition(Screen4_Circle10, 0, 0);
    Screen4_Circle10->fn->setSize(Screen4_Circle10, 800, 480);
    Screen4_Circle10->fn->setScheme(Screen4_Circle10, &BaseBlack_ForegroundRed);
    Screen4_Circle10->fn->setRadius(Screen4_Circle10, 10);
    Screen4_Circle10->fn->setThickness(Screen4_Circle10, 2);
    root0->fn->addChild(root0, (leWidget*)Screen4_Circle10);

    Screen4_Circle25 = leCircleWidget_New();
    Screen4_Circle25->fn->setPosition(Screen4_Circle25, 0, 0);
    Screen4_Circle25->fn->setSize(Screen4_Circle25, 800, 480);
    Screen4_Circle25->fn->setScheme(Screen4_Circle25, &BaseBlack_ForegroundRed);
    Screen4_Circle25->fn->setRadius(Screen4_Circle25, 25);
    Screen4_Circle25->fn->setThickness(Screen4_Circle25, 2);
    root0->fn->addChild(root0, (leWidget*)Screen4_Circle25);

    Screen4_Circle40 = leCircleWidget_New();
    Screen4_Circle40->fn->setPosition(Screen4_Circle40, 0, 0);
    Screen4_Circle40->fn->setSize(Screen4_Circle40, 800, 480);
    Screen4_Circle40->fn->setScheme(Screen4_Circle40, &BaseBlack_ForegroundRed);
    Screen4_Circle40->fn->setRadius(Screen4_Circle40, 40);
    Screen4_Circle40->fn->setThickness(Screen4_Circle40, 2);
    root0->fn->addChild(root0, (leWidget*)Screen4_Circle40);

    Screen4_Circle55 = leCircleWidget_New();
    Screen4_Circle55->fn->setPosition(Screen4_Circle55, 0, 0);
    Screen4_Circle55->fn->setSize(Screen4_Circle55, 800, 480);
    Screen4_Circle55->fn->setScheme(Screen4_Circle55, &BaseBlack_ForegroundRed);
    Screen4_Circle55->fn->setRadius(Screen4_Circle55, 55);
    Screen4_Circle55->fn->setThickness(Screen4_Circle55, 2);
    root0->fn->addChild(root0, (leWidget*)Screen4_Circle55);

    Screen4_Circle70 = leCircleWidget_New();
    Screen4_Circle70->fn->setPosition(Screen4_Circle70, 0, 0);
    Screen4_Circle70->fn->setSize(Screen4_Circle70, 800, 480);
    Screen4_Circle70->fn->setScheme(Screen4_Circle70, &BaseBlack_ForegroundRed);
    Screen4_Circle70->fn->setRadius(Screen4_Circle70, 70);
    Screen4_Circle70->fn->setThickness(Screen4_Circle70, 2);
    root0->fn->addChild(root0, (leWidget*)Screen4_Circle70);

    Screen4_Circle85 = leCircleWidget_New();
    Screen4_Circle85->fn->setPosition(Screen4_Circle85, 0, 0);
    Screen4_Circle85->fn->setSize(Screen4_Circle85, 800, 480);
    Screen4_Circle85->fn->setScheme(Screen4_Circle85, &BaseBlack_ForegroundRed);
    Screen4_Circle85->fn->setRadius(Screen4_Circle85, 85);
    Screen4_Circle85->fn->setThickness(Screen4_Circle85, 2);
    root0->fn->addChild(root0, (leWidget*)Screen4_Circle85);

    Screen4_Line0 = leLineWidget_New();
    Screen4_Line0->fn->setPosition(Screen4_Line0, 0, 0);
    Screen4_Line0->fn->setSize(Screen4_Line0, 800, 480);
    Screen4_Line0->fn->setScheme(Screen4_Line0, &BaseBlack_ForgroundWhite);
    Screen4_Line0->fn->setBackgroundType(Screen4_Line0, LE_WIDGET_BACKGROUND_NONE);
    Screen4_Line0->fn->setEndPoint(Screen4_Line0, 800, 480);
    root0->fn->addChild(root0, (leWidget*)Screen4_Line0);

    Screen4_Line80 = leLineWidget_New();
    Screen4_Line80->fn->setPosition(Screen4_Line80, 0, 0);
    Screen4_Line80->fn->setSize(Screen4_Line80, 800, 480);
    Screen4_Line80->fn->setScheme(Screen4_Line80, &BaseBlack_ForgroundWhite);
    Screen4_Line80->fn->setBackgroundType(Screen4_Line80, LE_WIDGET_BACKGROUND_NONE);
    Screen4_Line80->fn->setStartPoint(Screen4_Line80, 0, 80);
    Screen4_Line80->fn->setEndPoint(Screen4_Line80, 800, 400);
    root0->fn->addChild(root0, (leWidget*)Screen4_Line80);

    Screen4_Line160 = leLineWidget_New();
    Screen4_Line160->fn->setPosition(Screen4_Line160, 0, 0);
    Screen4_Line160->fn->setSize(Screen4_Line160, 800, 480);
    Screen4_Line160->fn->setScheme(Screen4_Line160, &BaseBlack_ForgroundWhite);
    Screen4_Line160->fn->setBackgroundType(Screen4_Line160, LE_WIDGET_BACKGROUND_NONE);
    Screen4_Line160->fn->setStartPoint(Screen4_Line160, 0, 160);
    Screen4_Line160->fn->setEndPoint(Screen4_Line160, 800, 320);
    root0->fn->addChild(root0, (leWidget*)Screen4_Line160);

    Screen4_Line240 = leLineWidget_New();
    Screen4_Line240->fn->setPosition(Screen4_Line240, 0, 0);
    Screen4_Line240->fn->setSize(Screen4_Line240, 800, 480);
    Screen4_Line240->fn->setScheme(Screen4_Line240, &BaseBlack_ForgroundWhite);
    Screen4_Line240->fn->setBackgroundType(Screen4_Line240, LE_WIDGET_BACKGROUND_NONE);
    Screen4_Line240->fn->setStartPoint(Screen4_Line240, 0, 240);
    Screen4_Line240->fn->setEndPoint(Screen4_Line240, 800, 240);
    root0->fn->addChild(root0, (leWidget*)Screen4_Line240);

    Screen4_Line320 = leLineWidget_New();
    Screen4_Line320->fn->setPosition(Screen4_Line320, 0, 0);
    Screen4_Line320->fn->setSize(Screen4_Line320, 800, 480);
    Screen4_Line320->fn->setScheme(Screen4_Line320, &BaseBlack_ForgroundWhite);
    Screen4_Line320->fn->setBackgroundType(Screen4_Line320, LE_WIDGET_BACKGROUND_NONE);
    Screen4_Line320->fn->setStartPoint(Screen4_Line320, 0, 320);
    Screen4_Line320->fn->setEndPoint(Screen4_Line320, 800, 160);
    root0->fn->addChild(root0, (leWidget*)Screen4_Line320);

    Screen4_Line400 = leLineWidget_New();
    Screen4_Line400->fn->setPosition(Screen4_Line400, 0, 0);
    Screen4_Line400->fn->setSize(Screen4_Line400, 800, 480);
    Screen4_Line400->fn->setScheme(Screen4_Line400, &BaseBlack_ForgroundWhite);
    Screen4_Line400->fn->setBackgroundType(Screen4_Line400, LE_WIDGET_BACKGROUND_NONE);
    Screen4_Line400->fn->setStartPoint(Screen4_Line400, 0, 400);
    Screen4_Line400->fn->setEndPoint(Screen4_Line400, 800, 80);
    root0->fn->addChild(root0, (leWidget*)Screen4_Line400);

    Screen4_Line480 = leLineWidget_New();
    Screen4_Line480->fn->setPosition(Screen4_Line480, 0, 0);
    Screen4_Line480->fn->setSize(Screen4_Line480, 800, 480);
    Screen4_Line480->fn->setScheme(Screen4_Line480, &BaseBlack_ForgroundWhite);
    Screen4_Line480->fn->setBackgroundType(Screen4_Line480, LE_WIDGET_BACKGROUND_NONE);
    Screen4_Line480->fn->setStartPoint(Screen4_Line480, 0, 480);
    Screen4_Line480->fn->setEndPoint(Screen4_Line480, 800, 0);
    root0->fn->addChild(root0, (leWidget*)Screen4_Line480);

    Screen4_TouchAnywhereLabel = leLabelWidget_New();
    Screen4_TouchAnywhereLabel->fn->setPosition(Screen4_TouchAnywhereLabel, 80, 440);
    Screen4_TouchAnywhereLabel->fn->setSize(Screen4_TouchAnywhereLabel, 660, 30);
    Screen4_TouchAnywhereLabel->fn->setScheme(Screen4_TouchAnywhereLabel, &BaseWhite_TextBlack);
    Screen4_TouchAnywhereLabel->fn->setHAlignment(Screen4_TouchAnywhereLabel, LE_HALIGN_CENTER);
    Screen4_TouchAnywhereLabel->fn->setVAlignment(Screen4_TouchAnywhereLabel, LE_VALIGN_TOP);
    Screen4_TouchAnywhereLabel->fn->setString(Screen4_TouchAnywhereLabel, (leString*)&string_TouchAnywhere);
    root0->fn->addChild(root0, (leWidget*)Screen4_TouchAnywhereLabel);

    leAddRootWidget(root0, 0);
    leSetLayerColorMode(0, LE_COLOR_MODE_RGB_565);

    showing = LE_TRUE;

    return LE_SUCCESS;
}

void screenUpdate_Screen4(void)
{
}

void screenHide_Screen4(void)
{

    leRemoveRootWidget(root0, 0);
    leWidget_Delete(root0);
    root0 = NULL;

    Screen4_PanelWidget0 = NULL;
    Screen4_Circle10 = NULL;
    Screen4_Circle25 = NULL;
    Screen4_Circle40 = NULL;
    Screen4_Circle55 = NULL;
    Screen4_Circle70 = NULL;
    Screen4_Circle85 = NULL;
    Screen4_Line0 = NULL;
    Screen4_Line80 = NULL;
    Screen4_Line160 = NULL;
    Screen4_Line240 = NULL;
    Screen4_Line320 = NULL;
    Screen4_Line400 = NULL;
    Screen4_Line480 = NULL;
    Screen4_TouchAnywhereLabel = NULL;


    showing = LE_FALSE;
}

void screenDestroy_Screen4(void)
{
    if(initialized == LE_FALSE)
        return;

    initialized = LE_FALSE;
}

leWidget* screenGetRoot_Screen4(uint32_t lyrIdx)
{
    if(lyrIdx >= LE_LAYER_COUNT)
        return NULL;

    switch(lyrIdx)
    {
        case 0:
        {
            return root0;
        }
        default:
        {
            return NULL;
        }
    }
}

